package com.huayi.datagovernance.common;

import cn.hutool.core.collection.ListUtil;

import java.util.*;

/**
 * 系统常量
 *
 * @author wuch
 * @version 1.0
 * @date 2021/4/12 16:43
 */
public class SysConstant {
    public static String problemDevice = "problemDevice";
    //=======================第三方服务地址========================//
    //专线提交数据代理回写
    public static final String SEND_DATA_2_GIS_URL = "http://25.39.65.83:17002/task/sendDataToGis";
    //        public static final String SEND_DATA_2_GIS_URL= "http://192.168.1.32:8099/task/sendDataToGis";
    //数据治理平台 下发图形信息服务URL
    public static final String NOTIC_SEND_OUTPIC_URL = "http://25.39.65.83:17002/sxMap/distributDeviceToAndroid";

    //=======================常用字段名========================//
    public static final String FIELD_VERSIONID = "versionid";
    public static final String FIELD_TQSBID = "tqsbid";
    public static final String FIELD_GDTYPE = "gdtype";
    public static final String FIELD_MODELNAME = "modelname";
    public static final String FIELD_CLASSID = "classid";
    public static final String FIELD_MODELID = "modelid";
    public static final String FIELD_SHAPE = "shape";
    public static final String FIELD_POINTS = "points";
    public static final String FIELD_TX_TABLE = "txTableName";
    public static final String FIELD_ZY_TABLE = "zyTableName";
    public static final String FIELD_TZ_TABLE = "tzTableName";
    public static final String FIELD_IS_DONE = "isdone";
    public static final String FIELD_SEARCH_NAME = "searchname";
    public static final String FIELD_USER_ID = "userid";
    public static final String FIELD_ORG_NO = "orgNo";
    public static final String FIELD_CURR_PAGE = "currPage";
    public static final String FIELD_PAGE_SIZE = "pageSize";
    public static final String FIELD_SBZLX = "sbzlx";
    public static final String FIELD_OID = "oid";
    public static final String FIELD_SBOID = "sboid";
    public static final String FIELD_SBID = "sbid";
    public static final String FIELD_OBJ_ID = "obj_id";
    public static final String FIELD_SFTS = "sfts";

    public static final String MODELNAME_DY_XL = "dysb_dyxl";
    public static final String MODELNAME_XL = "zwyc_xl";
    public static final String MODELNAME_DY_WLGT = "dysb_dywlg";
    public static final String MODELNAME_WLGT = "zwyc_wlg";

    //设备类型
    //避雷器modelid
    public static List<String> blqClassids = Arrays.asList("116000","318000","3109000","3312000");
    //朗新工单线路类型
    public static final int XL_SBZLX = 10000000;

    //物理杆
    public static final int DY_CLASSID_WLGT = 3102000;
    public static final int CLASSID_WLGT = 103000;
    //物理杆sbzlx判断
    public static final List<String> MODELIDS_WLG = ListUtil.list(false, "10300000", "10300001", "310200000", "310200001");

    //所属间隔
    public static final int CLASSID_JGDY = 380000;
    public static final int DY_MODELID_JGDY = 38000001;
    public static final int MODELID_JGDY = 38000000;

    //电站
    public static final int CLASSID_DZ = 300000;

    //运行杆
    public static final int DY_CLASSID_YXGT = 3114000;
    public static final int CLASSID_YXGT = 102000;
    //导线
    public static final int DY_CLASSID_DX = 3101100;
    public static final int DY_MODELID_DX = 310110000;
    public static final int CLASSID_DX = 101100;
    //导线段
    public static final int DY_CLASSID_DXD = 3101000;
    public static final int CLASSID_DXD = 101000;
    //电缆段
    public static final int DY_CLASSID_DLD = 3201000;
    public static final int CLASSID_DLD = 201000;
    //电缆
    public static final int DY_CLASSID_DL = 3204000;
    public static final int CLASSID_DL = 208000;
    //低压线路
    public static final int DY_CLASSID_XL = 3100000;
    public static final int CLASSID_XL = 100000;
    //低压电缆终端
    public static final int DY_CLASSID_DLZD = 3202000;
    public static final int CLASSID_DLZD = 202000;
    //接入点
    public static final int DY_CLASSID_JRD = 3218000;
    public static final int CLASSID_JRD = 370000;

    //接入点
    public static final int DY_CLASSID_ZSDLSRDQ = 3106000;
    public static final int CLASSID_ZSDLSRDQ = 115000;

    //站内-连接线
    public static final int MODELID_ZNLJX = 36000000;

    //站内出线点
    public static final int MODELID_ZNCXD = 32000000;

    //用电-计量箱
    public static final int DY_MODELID_JLX = 410300000;

    //变压器
    public static final int CLASSID_ZSBYQ = 110000;//柱上-变压器
    public static final int CLASSID_PDBYQ = 302000;//配电-变压器

    //=======================数据库ID========================//
    public static final String DBSOURCE_POSTGRESQL = "local";
    public static final String DBSOURCE_ORACLE = "lx";
    public static final String DBSOURCE_YX = "yx";

    //=======================数据库模式========================//
    public static final String DB_SCHEMA_SXYKTEST = "sxyktest";
    public static final String DB_SCHEMA_YWSJ = "ywsj";
    public static final String DB_SCHEMA_CONF = "conf";
    public static final String DB_SCHEMA_DWZY = "dwzy";
    public static final String DB_SCHEMA_SCYW = "scyw";
    public static final String DB_SCHEMA_TOPO = "topo";
    public static final String DB_SCHEMA_ZY_CL = "ZY_CL";
    public static final String DB_SCHEMA_SGPM = "SGPM";
    public static final String DB_SCHEMA_YPGT_TZY = "YPGT_TZY";

    //------------------序列-----------------------------
    public static final String SEQ_TOPO = "conf_toporelation_xx";
    public static final String GIS_CONF_TOPORELATION = "CONF_TOPORELATION";//gis的端子号序列

    //=======================缓存资源========================//
    /**
     * 缓存地图资源
     * KEY: 地图资源ID, VALUE：地图资源 （List , 下标就是第几次请求）
     */
    public static Map<String, List<String>> CACHE_MAP_DATA = new HashMap<>(10);


    //=======================文件后缀========================//
    public static final String SUFFIXE_TXT = ".txt";
    public static final String SUFFIXE_ZIP = ".zip";

    //=======================表前后缀========================//
    //拓扑关系存储表
    public static final String TOPO_TABLE = "topo.conf_toporelation_xx_ver";

    public static final String PREFIX_TABLE_TX = "t_tx_";
    public static final String PREFIX_TABLE_ZY = "t_zy_";
    public static final String PREFIX_TABLE_SB = "t_sb_";
    public static final String SUFFIX_TABLE_VER = "_ver";

    public static final String SQL_WHERE = "1=1";

    //=======================判断标志========================//
    /**
     * autoCreateModel批量建模接口
     * 入参数据类型（0：资源表数据  1：台账表数据）
     */
    public static final String MODEL_TYPE = "model_type";
    public static final int MODEL_ZY = 0;
    public static final int MODEL_TZ = 1;

    // sfts-是否推送
    public static final int SFTS_NO_ISSUE = 0;//未下发
    public static final int SFTS_ISSUE = 1;//已下发
    public static final int SFTS_PUSH_WEB = 2;//已推送web
    public static final int SFTS_AUDIT_SUCCESS = 3;//审核成功
//    public static final int SFTS_AUDIT_FAILED=-1;//审核失败

    //出图 任务状态
    public static final String TASK_STATUS = "taskStatus";//任务状态字段名
    public static final String TASK_STATUS_YES = "1";//已办
    public static final String TASK_STATUS_NO = "0";//未办

    /**
     * 加载地图资源
     * 行为（0：加载地图资源  1：分页获取数据）
     */
    public static final String MAP_LOAD = "0";
    public static final String MAP_GET = "1";

    //点线面
    public static final String SHAPE_POINT = "POINT";
    public static final String SHAPE_LINESTRING = "LINESTRING";
    public static final String SHAPE_POLYGON = "POLYGON";
    public static Map<String, String> SHAPE_TYPE = new HashMap<String, String>() {{
        put("2001", "POINT"); // 点 POINT(0 0)
        put("2002", "LINESTRING"); // 线 LINESTRING(0 0,1 1,1 2)
        put("2003", "POLYGON");// 面 POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))
    }};

    //工单类型：1为专线，台区为2, 业扩为3，高压核查为4
    public static final String TASK_STATE_ZX = "1";
    public static final String TASK_STATE_TQ = "2";
    public static final String TASK_STATE_YK = "3";
    public static final String TASK_STATE_HIGH_CHECK = "4";
    public static Map<String, String> TASK_STATE_TABLE = new HashMap<>();

    //下发数据表
    static {
        TASK_STATE_TABLE.put(TASK_STATE_ZX, "t_yw_zxdata");
        TASK_STATE_TABLE.put(TASK_STATE_TQ, "t_yw_tqzxdata");
    }

    // 2，3，4都是专线任务
    public static List<String> TASK_STATE_ZXS = new ArrayList<>();

    static {
        TASK_STATE_ZXS.add(TASK_STATE_ZX);
        TASK_STATE_ZXS.add(TASK_STATE_YK);
        TASK_STATE_ZXS.add(TASK_STATE_HIGH_CHECK);
    }

    //工单任务状态是否完成（isdone）
    public static final int IS_DONE_TRUE = 1;
    public static final int IS_DONE_FALSE = 0;

    //高压核查工单状态 1 待核查  2 待审核 3 已完成  -1 待完善
    public static final String HIGH_CHECK_STATE_SUCCESS = "3";

    //------------任务处处理类型: 0-未处理 1-app端(现场)处理 2-web端(系统)处理---------
    public static final int RESOLVE_TYPE_NO = 0; //未处理
    public static final int RESOLVE_TYPE_APP = 1; //app端(现场)处理
    public static final int RESOLVE_TYPE_WEB = 2; //web端(系统)处理

    //操作类型:1.新增，2.编辑，3.删除
    public static final int operate_add = 1;
    public static final int operate_edit = 2;
    public static final int operate_del = 3;

    //APP签到操作
    public static final String OPERATE_SIGNIN = "1";

    //低压台区箱表采集  审核状态
    public static final String TQ_BX_COLLECT_YES="1";//已审核
    public static final String TQ_BX_COLLECT_NO="0";//未审核
}
